
import Ember from 'ember';
import BaseBusiness from '../base-business';
export default BaseBusiness.extend({
  queryParams: {
    source: {
      refreshModel: true
    }
  },
  model(params){
    this.set('header_title','修改');
    var curUser = this.get("global_curStatus").getUser();//拿到数据
    var model = {isInCrumb: false};
    model.curUser = curUser;
    return model;
  },
  setupController: function(controller,model){
    this._super(controller,model);
    controller.set('succeed',null);
    var curUser = this.get("global_curStatus").getUser();
    var source = controller.get("source");
    if(source === 'introduce'){
      controller.set('curUserIntroduce',false);
    }else {
      controller.set('curUserIntroduce',true);
      if(source === 'age'){
        controller.set('edit' ,curUser.get('age'));
      }
      if(source === 'name'){
        controller.set('edit' ,curUser.get('name'));
      }
      if(source === 'email'){
        controller.set('edit' , curUser.get('email'));
      }
      if(source === 'phone'){
        controller.set('edit' , curUser.get('phone'));
      }
      if(source === 'weixin'){
        controller.set('edit' , curUser.get('weixin'));
      }
    }
  },
  actions:{
    reloadModel:function(){
      this.refresh();
    },
  }

});
